<template>
	<view>
		<view class="winhistory" v-for="(item,i) in orderQishus" :key="item.id" @click="goOrderDetail(item.id)">
			<div style="line-height:12px;font-size:10px;background-color: white;padding: 0 0 20rpx 30rpx;border-bottom: 1rpx #CCCCCC solid;">
			   <p>
				  手机号：{{!isNull(item.userinfo) ? (item.userinfo.usersPhone.substr(0 , 3)+ "****"+item.userinfo.usersPhone.substr(7 , 11)) : ""}}
				  <span v-if="item.isWin==1" style="color: red;padding-left: 6px;">中奖</span>
			   </p>	
			   <p>幸运号：{{item.xinyunhao}}</p>
			   <p>幸运币：{{item.price}}</p>
			   <p>期&#12288;数：{{item.qishuObj.qishu}}</p>
			   <p>时&#12288;间：{{item.endtime}}</p>
			</div>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				id:'',			//幸运期数ID
				orderQishus:[],	//期数详情数组
			}
		},
		onLoad(opt) {
			this.id = opt.id;
			this.getOrderQishu(opt.id)
		},
		methods: {
			//得详细信息
			getOrderQishu(id){
				this.$http.get('/xingyun/order_qishu/'+id,{
					page:'1',
					limit:'1000'
				}).then(res => {
					console.log(res.data)
					this.orderQishus = res.data.data;
				})
			},
			//跳转到订单详情
			goOrderDetail(id){
				uni.navigateTo({
					url:'winOrderDetail?id='+id
				})
			},
			//判断为空
			isNull(str){
				return str==null || str=="" || str==undefined
			}
		}
	}
</script>

<style>
	p{
		padding-top: 20rpx;
		color: #8f8f94;
	}
</style>
